﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.Track>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Html.Encode(Model.title) %> - נלך
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HeadContent" runat="server">
   <meta name="description" content="<%= Html.Encode(Model.summary) %>" />
</asp:Content>
<asp:Content ContentPlaceHolderID="Right" ID="Content4" runat="server">
    <p>
        <iframe src="http://www.israelweather.co.il/upload/weekly<%= Html.Encode(Model.Regeon1.weather) %>.html"
            width="200" height="125" dir="rtl" name='in_frame' frameborder='0' scrolling='No'>
        </iframe>
    </p>
       <%var array = (int[])ViewData["advertsArray"];
         var count = (int)ViewData["advertCount"];
         if (count > 0)
                Html.RenderAction("AdvertShowThree", "Advert", new { id = 6, region = Model.regeon, noRandom = array[0] });%> 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="left">
        <div class="gallerycontainer">
            <% 
                var en = Model.Image.OrderBy(p => p.path, new nelech.Views.Shared.Code.ImagePathComparer()).GetEnumerator();
                for (var i = 0; i < 7; i++)
                {
                    if (!en.MoveNext())
                        break;

                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
            %>
            <a class="thumbnail" href="#thumb">
                <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" width="150px" /><br />
                <span>
                    <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                    <br />
                    <%=image.text%></span></a>
            <%=image.text%>
            <%
                }
            %>
            <%Html.RenderAction("AdvertShow", "Advert", new { id = 7, region = Model.regeon });%>
        </div>
    </div>
    <div id="main">
        <h2>
            <%= Html.Encode(Model.title)%></h2>
        <p class="print">
            <a href="javascript:window.print()">הדפס דף זה</a>
        </p>
        <fieldset>
            <legend>פרטים:</legend>
            <%if (Model != null && Model.Subject.Count() != 1)
              {%><span class="bold">נושא:</span>
            <% foreach (var subject in Model.Subject)
               {
                   Response.Write(subject.text + ", ");
               }
             
            %><br />
            <%} %>
            <%if (Model != null && Model.Season.Count() > 0)
              {%>
            <span class="bold">עונה:</span>
            <%    foreach (var season in Model.Season)
                  {
                      Response.Write(season.text + ", ");
                  }
              
            %><br />
            <%} %>
            <%if (Model != null && Model.Traffic.Count() != 0)
              {%>
            <span class="bold">תחבורה:</span>
            <%   foreach (var traffic in Model.Traffic)
                 {
                     Response.Write(traffic.text + ", ");
                 }
              
            %><br />
            <%} %>
            <span class="bold">מחיר:</span>
            <%= Html.Encode(Model.Cost1.text) %><br />
            <span class="bold">משך:</span>
            <%= Html.Encode(Model.Duration1.text) %><br />
            <span class="bold">זמן:</span>
            <%= Html.Encode(Model.Time1.text) %><br />
            <span class="bold">קושי:</span>
            <%= Html.Encode(Model.Difficulty1.text) %><br />
            <span class="bold">מים:</span>
            <%if (Model.water == 1)
              { %>יש<%}
              else
              {%>אין<%} %><br />
            <% if (Model.km != null)
               {%>
            <span class="bold">אורך בק"מ:</span>
            <%= Html.Encode(Model.km + " ק\"מ")%><br />
            <%} %>
            <%= Html.Encode(Model.Circle1.circle1) %><br />
            <span class="bold">במפת סימון שבילים:</span>
            <%= Html.Encode(Model.Regeon1.id + " - " + Model.Regeon1.text) %>
            <% if (!string.IsNullOrEmpty(Model.annanLink))
               {%>
            <a href="<%= Model.annanLink%>" target="_blank">קישור למפה טופוגרפית באתר עמוד ענן</a><%}%>
        </fieldset>
        <fieldset>
            <legend>תקציר:</legend>
            <div class="summary">
                <%= Html.Encode(Model.summary) %></div>
        </fieldset>
        <div class="description">

        
            <% if (en.MoveNext())
               { 
            %>
            <div class="gallerycontainer">
                <%
                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
                %>
                <a class="thumbnail" href="#thumb">
                    <p>
                        <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" height="130px" /><br />
                        <%=image.text%></p>
                    <span>
                        <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                        <br />
                        <%=image.text%>
                    </span></a>
            </div>
            
            <%} %>
              
            <%if (!String.IsNullOrEmpty(Model.coming))
              { %>
            <h3>
                איך מגיעים?</h3>
            <%= Model.coming%>
            <%}%>
            <% if (en.MoveNext())
               { 
            %>
            <div class="gallerycontainer">
                <%
                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
                %>
                <a class="thumbnail" href="#thumb">
                    <p>
                        <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" height="130px" /><br />
                        <%=image.text%></p>
                    <span>
                        <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                        <br />
                        <%=image.text%>
                    </span></a>
            </div>
            <%} %>
            <%if (!String.IsNullOrEmpty(Model.history))
              { %>
            <h3>
                מידע כללי</h3>
            <%= Model.history %>
            <%} %>
            <% if (en.MoveNext())
               { 
            %>
            <div class="gallerycontainer">
                <%
                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
                %>
                <a class="thumbnail" href="#thumb">
                    <p>
                        <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" height="130px" /><br />
                        <%=image.text%></p>
                    <span>
                        <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                        <br />
                        <%=image.text%>
                    </span></a>
            </div>
            <%} %>
            <h3>
                פירוט:</h3>
            <%= Model.details %>
             <%if (!String.IsNullOrEmpty(Model.warning))
              { %>
              <fieldset class="warning">
            <legend>
              דגשים נוספים:</legend>
            <%= Model.warning %>
            </fieldset>
            <%} %>
            <div id="map" />
        </div>
        <% 
            var renderPlace = nelech.Views.Shared.Code.Utils.GetEmbeddedString("nelech.Views.Shared.RenderPlaceOnWazeFunction.txt");

            Response.Write(renderPlace);
        %>
        <%
            Response.Write(
                "<script>" +
                "function onInit()"+
                "{" +
                "RenderPlaceOnWaze(" + Model.lon + "," + Model.lat + ",'" + Model.title.Replace("'", "\\'") + "','http://nelech.co.il/Content/Images/wazelogo1.png');" +
                "}" +
                "</script>"
                );
        %>
        <%
            var wazeBody = nelech.Views.Shared.Code.Utils.GetEmbeddedString("nelech.Views.Shared.WazeBody.txt");
            wazeBody = wazeBody.Replace("{0}", Model.lon.ToString());
            wazeBody = wazeBody.Replace("{1}", Model.lat.ToString());
            Response.Write(wazeBody);
        %>
        <p>
            המפה באדיבות WAZE - קהילת הנהגים של ישראל (ראה <a href="http://waze.co.il">waze.co.il</a>)</p>
        <%
            if (!String.IsNullOrEmpty(Model.nearby))
            {
        %>
        <h3>
            מקומות קרובים:</h3>
        <%= Model.nearby %>
        <%} %></div>
    <% if (!string.IsNullOrEmpty(Model.map))
       { %>
    <p>
        <img src="<%= Model.map %>" />
    </p>
    <%} %>
   
     <%if (Model.chackted != null)
      { %>
  <p>
    <span class="bold">נבדק לאחרונה בתאריך:</span>  <%=nelech.Views.Shared.Code.Utils.GetHebrewJewishDateString(Model.chackted.Value, true)%>, <%: Model.chackted.Value.ToString("dd/MM/yyyy") %>
  </p>
  <%} %>
  <div class="fb-like" data-href="http://www.facebook.com/www.nelech.co.il" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
    <%
        Html.RenderPartial("ListFeedback", ViewData["ListFeedbacks"]);
    %>
    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="http://www.waze.co.il/js/OpenLayers.js"> </script>

    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="http://www.waze.co.il/js/jquery.js"></script>

    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="http://www.waze.co.il/js/mapnik.js"></script>

    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="http://www.waze.co.il/js/WazePanZoomBar.js"></script>

    <script type="text/javascript" src="http://www.waze.co.il/js/WazeEmbeddedMap.js"></script>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightAdvert" runat="server">
<%var count = (int)ViewData["advertCount"];
  var array = (int[])ViewData["advertsArray"];
  if (count > 0)
  {

      Html.RenderAction("AdvertShow", "Advert", new { id = 6,region = Model.regeon, random1 = array[0] });
  }%>
  
</asp:Content>
 